// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class CD : AbstractDataType
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 Channel Identifier",1)]
  	    [HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.True,"CM")]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.True,"WVI")]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.True,"WVI")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.True,"WVI")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.True,"WVI")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.True,"WVI")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.True,"WVI")]
	    public WVI ChannelIdentifier {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Waveform Source",2)]
  	    [HL7Field(HL7Version.v23, 2, HL7Repeat.False, HL7Required.True,"CM")]
  	    [HL7Field(HL7Version.v231, 2, HL7Repeat.False, HL7Required.True,"WVS")]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"WVS")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"WVS")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"WVS")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"WVS")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"WVS")]
	    public WVS WaveformSource {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 Channel Sensitivity And Units",3)]
  	    [HL7Field(HL7Version.v23, 3, HL7Repeat.False, HL7Required.True,"CM")]
  	    [HL7Field(HL7Version.v231, 3, HL7Repeat.False, HL7Required.True,"CSU")]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.False, HL7Required.True,"CSU")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.False, HL7Required.True,"CSU")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.False, HL7Required.True,"CSU")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.False, HL7Required.True,"CSU")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.False, HL7Required.True,"CSU")]
	    public CSU ChannelSensitivityAndUnits {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Channel Calibration Parameters",4)]
  	    [HL7Field(HL7Version.v23, 4, HL7Repeat.False, HL7Required.True,"CM")]
  	    [HL7Field(HL7Version.v231, 4, HL7Repeat.False, HL7Required.True,"CCP")]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.False, HL7Required.True,"CCP")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.False, HL7Required.True,"CCP")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.False, HL7Required.True,"CCP")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.False, HL7Required.True,"CCP")]
  	    [HL7Field(HL7Version.v27, 4, HL7Repeat.False, HL7Required.True,"CCP")]
	    public CCP ChannelCalibrationParameters {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Channel Sampling Frequency",5)]
  	    [HL7Field(HL7Version.v23, 5, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v231, 5, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.False, HL7Required.True,"NM")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.False, HL7Required.True,"NM")]
	    public NM ChannelSamplingFrequency {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Minimum And Maximum Data Values",6)]
  	    [HL7Field(HL7Version.v23, 6, HL7Repeat.False, HL7Required.True,"CM")]
  	    [HL7Field(HL7Version.v231, 6, HL7Repeat.False, HL7Required.True,"NR")]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"NR")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"NR")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"NR")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"NR")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"NR")]
	    public NR MinimumAndMaximumDataValues {get;set;}





		public override string GetER7(HL7ParserOptions options) {
			List<string> dataTypeParts = new List<string>();
			dataTypeParts.Add(GetER7TextForDataPart(ChannelIdentifier, options));
			dataTypeParts.Add(GetER7TextForDataPart(WaveformSource, options));
			dataTypeParts.Add(GetER7TextForDataPart(ChannelSensitivityAndUnits, options));
			dataTypeParts.Add(GetER7TextForDataPart(ChannelCalibrationParameters, options));
			dataTypeParts.Add(GetER7TextForDataPart(ChannelSamplingFrequency, options));
			dataTypeParts.Add(GetER7TextForDataPart(MinimumAndMaximumDataValues, options));
			return CleanUpTrailingComponentSeps(string.Join("" + options.ComponentSep, dataTypeParts.ToArray()), options);
		}
    }
}

